import numpy as np


def positional_encoding(max_seq_length, d_model):
    pos_encoding = np.zeros((max_seq_length, d_model))

    for pos in range(max_seq_length):
        for i in range(0, d_model, 2):
            pos_encoding[pos, i] = np.sin(pos / np.power(10000, i / d_model))
            if i + 1 < d_model:
                pos_encoding[pos, i + 1] = np.cos(pos / np.power(10000, (i + 1) / d_model))

    return pos_encoding

max_seq_length = 100
d_model = 512
pos_encoding = positional_encoding(max_seq_length, d_model)
print(pos_encoding)